<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>地图页面</title>
    <style>
        #map-container {
            width: 100%;
            height: 80vh;
            border: 1px solid #ccc;
        }
    </style>
</head>
<body>
    <h1>推荐路线地图</h1>
    <div id="map-container"></div>
    <script src="https://api.map.baidu.com/api?v=3.0&ak={{ request.args.get('ak', '47jXQbiwPNWVY5GgVPUJYpOiHG5YhBcr') }}"></script>
    <script>
        // 初始化地图
        var map = new BMap.Map("map-container");
        var point = new BMap.Point(110.3434, 20.0456); // 默认中心点坐标（海口）
        map.centerAndZoom(point, 12); // 设置中心点和缩放级别

        // 添加标记
        var marker = new BMap.Marker(point);
        map.addOverlay(marker);

        // 添加路线规划功能（示例代码）
        function addRoute(start, end) {
            var driving = new BMap.DrivingRoute(map, { renderOptions: { map: map, autoViewport: true } });
            driving.search(start, end);
        }

        // 示例：添加一条路线
        addRoute("海口市骑楼老街", "海口市万绿园");
    </script>
</body>
</html>